https://leetcode.cn/problems/subtree-of-another-tree/

bool isSameTree(struct TreeNode* root, struct TreeNode* subRoot)
{
    if (root == NULL && subRoot == NULL)
    {
        return true;
    }
    else if (root == NULL || subRoot == NULL)
    {
        return false;
    }
    else {
        if (root->val != subRoot->val)
        {
            return false;
        }
        else {
            return isSameTree(root->left, subRoot->left) && isSameTree(root->right, subRoot->right);
        }
    }
}
bool isSubtree(struct TreeNode* root, struct TreeNode* subRoot) {
    if (root == NULL)
    {
        return false;
    }
    else
    {
        if (isSameTree(root, subRoot))
        {
            return true;
        }
        else {
            return isSubtree(root->left, subRoot) || isSubtree(root->right, subRoot);
        }
    }

}